#include <iostream>
#include <unistd.h>

void *ThreadStart(void *arg)
{
    while (true)
    {
        sleep(1);
        std::cout << "new thread pid:" << getpid() << std::endl;
    }
}
int main()
{
    pthread_t pth;
    pthread_create(&pth, nullptr, &ThreadStart, (void *)"new thread");

    while (true)
    {
        sleep(1);
        std::cout << "main thread pid:" << getpid() << std::endl;
    }
    return 0;
}